#region

using System;
using SFMLStart.Data;
using VeeTileEngine2012;

#endregion

namespace TimeDRODPOF.TDComponents
{
    public class TDCRenderDirectionAI : Component
    {
        public TDCRenderDirectionAI(TDCRender mRenderComponent, TDCDirection mDirectionComponent, string mTilesetName, string mPrefix = "", string mSuffix = "")
        {
            RenderComponent = mRenderComponent;
            DirectionComponent = mDirectionComponent;
            TilesetName = mTilesetName;
            Prefix = mPrefix;
            Suffix = mSuffix;

            RenderComponent.OnDraw += () => RenderComponent.Sprites.ForEach(x => x.TextureRect = Assets.Tilesets[TilesetName].GetTextureRect(Prefix + DirectionComponent.DirectionString + Suffix));
        }

        public TDCRender RenderComponent { get; set; }
        public TDCDirection DirectionComponent { get; set; }
        public string TilesetName { get; set; }
        public string Prefix { get; set; }
        public string Suffix { get; set; }
    }
}